<template>
  <div style="width: 80%">
    <h2 style="margin-bottom: 30px">新增研究生</h2>
    <el-form :inline="true" :model="form" label-width="120px">
      <el-form-item label="姓名">
        <el-input v-model="form.pname" placeholder="请输入姓名"></el-input>
      </el-form-item>
      <el-form-item label="学号">
        <el-input v-model="form.pno" placeholder="请输入学号"></el-input>
      </el-form-item>
      <el-form-item label="性别">
        <el-input v-model="form.psex" placeholder="请输入性别"></el-input>
      </el-form-item>
      <el-form-item label="系别">
        <el-input v-model="form.pdept" placeholder="请输入系别"></el-input>
      </el-form-item>
      <el-form-item label="年级">
        <el-input v-model="form.pclass" placeholder="请输入年级"></el-input>
      </el-form-item>
      <el-form-item label="班级">
        <el-input v-model="form.pgrade" placeholder="请输入班级"></el-input>
      </el-form-item>
    </el-form>

    <div style="text-align: center;margin-top: 30px">
      <el-button type="primary" @click="save" size="medium">提交</el-button>
    </div>
  </div>
</template>

<script>
import request from "@/utils/request";
export default {
  name: 'AddPostgaduate',
  data(){
  return{
    form:{}
  }
  },
  methods:{
    save(){
      request.post('/postgaduate/save', this.form).then(res => {
        if (res.code === '200') {
          this.$notify.success('新增成功')
        } else {
          this.$notify.error(res.msg)
        }
      })
    }
  }
}
</script>